﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PRO_DOCS.DAL.Database;
using System.Windows.Forms;
using System.Web.UI.WebControls;

namespace PRO_DOCS.DAL.AppCode
{
    public class AssetActions : MainClass
    {


        public static List<DAL.Database.APPLICATION_ACTION> GET_APPLICATION_ACTIONS()
        {
            List<DAL.Database.APPLICATION_ACTION> lstAssetActionTypes = PRO_DOCSDatabaseDataContext.APPLICATION_ACTIONs.ToList();
            return lstAssetActionTypes;
        }

        public static void FillAssetActionTypesComboBox(ComboBox comboActionTypes)
        {
            comboActionTypes.Items.Clear();

            List<DAL.Database.APPLICATION_ACTION> lstAssetActionTypes = GET_APPLICATION_ACTIONS();

            for (int i = 0; i < lstAssetActionTypes.Count; i++)
            {
                ListItem actionTypesItem = new ListItem();
                actionTypesItem.Text = lstAssetActionTypes[i].APPLICATION_ACTION_NAME;
                actionTypesItem.Value = lstAssetActionTypes[i].APPLICATION_ACTION_ID.ToString();
                comboActionTypes.Items.Add(actionTypesItem);
            }

            comboActionTypes.SelectedIndex = -1;
        }
    }
}
